package com.zan.pattern.decorator;

/**
 * @Author Zan
 * @Create 2024-04-25 23:29
 * @Description : 培根类（具体的装饰着角色）
 * @ClassName: Bacon
 */
public class Bacon extends Garnish {

    public Bacon(FastFood fastFood) {
        super(fastFood, 2, "培根");
    }

    @Override
    public float cost() {
        // 计算价格
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
